package com.yl.auth.controller;

import com.yl.auth.model.entity.Cuoyi;
import com.yl.auth.model.entity.Xiaocuoyi;
import com.yl.auth.service.CuoyiService;
import com.yl.common.result.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/admin/xiaochengxucuoyi")
@Api(tags = "小程序-养老护理-错衣缺衣")
public class Xiaochengxucuoyi {
    @Resource
    private CuoyiService cuoyiService;
    @GetMapping("/getcuoyis")
    @ApiOperation(value = "获取全部错衣信息不分页")
    public Result getcuoyis() {
        List<Cuoyi> pageVo = cuoyiService.getcuoyis();
        return Result.ok(pageVo);
    }
    @PostMapping("/addcuoyi")
    @ApiOperation(value = "添加错衣")
    public Result addcuoyi(@RequestBody Xiaocuoyi cuoyi){
        cuoyiService.save(cuoyi);
        return Result.ok();
    }
}
